#ifndef INCLUDES_H
#define INCLUDES_H

#include "board.h"

#include "version.h"
#include "common.h"
#include "storedata.h"
#include "gui.h"
#include "app_meter.h"
#include "signal_generator.h"
#include "oscilloscope.h"
#include "app_slave_device.h"
//#include "comm_apply.h"
#include "comm_master_apply.h"

#undef EXTERN
#ifndef APP_INIT_C
#define EXTERN extern
#else
#define EXTERN
#endif

enum{
    khmtEvent_StoreParaChange = 1<<0,
    khmtEvent_InfoParaChange = 1<<1,
    khmtEvent_RunParaChange = 1<<2,
    khmtEvent_StatusParaChange = 1<<3,
    khmtEvent_ParaChange = 0x0f,
};

enum {
    kSysEvent_PowerOff = 1<<0,
};


EXTERN SemaphoreHandle_t xSemaphoreSample;
EXTERN SemaphoreHandle_t xSemaphore_adc_int;
EXTERN EventGroupHandle_t hmt_device_event;
EXTERN EventGroupHandle_t sys_event;
EXTERN QueueHandle_t hmt_device_cmd_queue;
EXTERN SemaphoreHandle_t xSemaphoreOSC;
EXTERN int32_t turnoff_delay;

EXTERN storedata_t storedata;

EXTERN oscilloscope_t oscilloscope;

extern uint8_t app_init_flag;

extern void app_init(void);
extern void app_timer_task(uint16_t tick);
extern void app_create_task(void *para);

extern void task_cdc(void *para);
extern void task_gui(void *para);
extern void task_sample(void *para);
extern void task_meter(void *para);
extern void task_osc(void *para);
extern void task_comm(void *para);

#endif
